var layerId;
var  clickState = true;
$(function(){
	$("#save-button").click(function(){
		var isShow = $("input[name='isShow']:checked").val();
		var title = $("input[name='title']").val();
		var content = $("#content").val();
		var icon = $("#icon").attr("data-img");
		if(title.length == 0){
			layer.msg("请输入常见问题");
			return false;
		}
		if(content.length == 0){
			layer.msg("请输入答案");
			return false;
		}
		if(icon.length == 0){
			layer.msg("请上传封面图");
			return false;
		}
		var questionId=init.questionId;
		var question ={
			"id":questionId,
			"title":title,
			"content":content,
			"isShow":isShow,
			"icon":icon
		}
		if(clickState){
			clickState = false;
			$.ajax({
				url:basePath+"/question/save.shtml",
				data:question,
				type:"post",
				dataType:"JSON",
				success:ajaxSuccessCloseFun
			});
		}
	});
	$("#close-button").click(function(){
		parent.closeLayer(0);
	});
	
});
